package Object_2;

import java.util.Comparator;

public class Student2_Comparator implements Comparator <Student_2>{


    @Override
    public int compare(Student_2 o1, Student_2 o2) {
        if(o1.getScore() > o2.getScore()){
            return 1;
        }
        if(o1.getScore() < o2.getScore()){
            return -1;
        } else if(o1.getId() > o2.getId()){
            return 1;
        } else if(o1.getId() < o2.getId()){
            return -1;
        } else {
            return 0;
        }

    }
}
